package com.mck.controller;

import com.mck.entity.OperLog;
import com.mck.service.OperationLogService;
import com.mck.entity.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/api/public/operationLogs")
public class OperationLogController {
    
    @Autowired
    private OperationLogService operationLogService;

    /**
     * 获取用户操作日志
     */
    @GetMapping("/{userId}")
    public Result getUserOperationLogs(@PathVariable Integer userId) {
        List<OperLog> logs = operationLogService.getUserOperationLogs(userId);
        return Result.success(logs);
    }
}